package top.itmeans.yes.mapper;

import top.itmeans.yes.dto.OrderDeliveryParam;
import top.itmeans.yes.dto.OrderDetail;
import top.itmeans.yes.dto.OrderQueryParam;
import top.itmeans.yes.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author Yiming.Cao
 * @since 2022-04-28
 */
public interface OrderMapper extends BaseMapper<Order> {

    /**
     * 根据封装的查询参数去查询订单
     * @param queryParam 查询参数
     * @return List<Order> 订单集合
     */
    List<Order> getList(OrderQueryParam queryParam);

    int delivery(List<OrderDeliveryParam> deliveryParamList);

    /**
     * 多表查询，根据ID获取订单详细信息（t_order、t_order_item、t_order_operate_history）
     * @param id 订单ID
     * @return 封装的订单详情
     */
    OrderDetail getDetail(Long id);
}
